From: Jasper St. Pierre Date: Mon, 11 Mar 2013 21:11:51 +0000 (-0400) Subject: messageTray: Clean up code a tiny bit X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~4492 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=16547fb3c22fb9072a1320ed51628c56d3a6c84e;p=gnome-shell.git messageTray: Clean up code a tiny bit Remove some duplication by reusing a method. https://bugzilla.gnome.org/show_bug.cgi?id=695659 --- diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js index 83a0425a4..2c1f328ef 100644 --- a/js/ui/messageTray.js +++ b/js/ui/messageTray.js @@ -2620,10 +2620,9 @@ const MessageTray = new Lang.Class({ }, _expandNotification: function(autoExpanding) { - // Don't grab focus in notifications that are auto-expanded. + // Don't focus notifications that are auto-expanding. if (!autoExpanding) - this._grabHelper.grab({ actor: this._notification.actor, - grabFocus: true }); + this._ensureNotificationFocused(); if (!this._notificationExpandedId) this._notificationExpandedId = @@ -2653,8 +2652,6 @@ const MessageTray = new Lang.Class({ } }, - // We use this function to grab focus when the user moves the pointer - // to a notification with CRITICAL urgency that was already auto-expanded. _ensureNotificationFocused: function() { this._grabHelper.grab({ actor: this._notification.actor, grabFocus: true });